package Test;

import static org.junit.Assert.*;

import org.junit.Test;

import com.model.Card;
import com.model.Hand;
import com.model.Rank;
import com.model.Suit;
import com.strategies.DealerStrategy;
import com.strategies.PlayerStrategy1;

public class TestHand {

	@Test
	public void testHand() {
		Hand hand = new Hand(new PlayerStrategy1());
		
		hand.addCard(new Card(Suit.CLOVER, Rank.TWO));
		hand.addCard(new Card(Suit.DIAMONDS, Rank.TEN));
		
		assertTrue(hand.shouldHit(new Card(Suit.DIAMONDS, Rank.ACE)));
		assertTrue(hand.shouldHit(new Card(Suit.DIAMONDS, Rank.QUEEN)));
		assertTrue(hand.shouldHit(new Card(Suit.DIAMONDS, Rank.KING)));
		assertTrue(hand.shouldHit(new Card(Suit.DIAMONDS, Rank.TEN)));
		assertTrue(hand.shouldHit(new Card(Suit.DIAMONDS, Rank.NINE)));
		assertTrue(hand.shouldHit(new Card(Suit.DIAMONDS, Rank.EIGHT)));
		assertTrue(hand.shouldHit(new Card(Suit.DIAMONDS, Rank.TWO)));
	}
	
	@Test
	public void cannotSplittingAcesTwice() {
		Hand hand = new Hand(new PlayerStrategy1(), 1, false);
		
		hand.addCard(new Card(Suit.CLOVER, Rank.ACE));
		hand.addCard(new Card(Suit.DIAMONDS, Rank.ACE));
		
		assertFalse(hand.canDouble());
	}
}
